package com.shitou.springai1.admin.utils;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.security.crypto.password.PasswordEncoder;
import org.springframework.stereotype.Component;

// 创建一个临时工具类来验证密码
@Component
public class PasswordVerifier {

    @Autowired
    private PasswordEncoder passwordEncoder;

    public void verifyPassword(String rawPassword, String encodedPassword) {
        System.out.println("=== 密码验证 ===");
        System.out.println("原始密码: " + rawPassword);
        System.out.println("加密密码: " + encodedPassword);
        boolean matches = passwordEncoder.matches(rawPassword, encodedPassword);
        System.out.println("密码匹配结果: " + matches);
        System.out.println("===============");
    }
}
